import {
    createRouter,
    createWebHashHistory
} from 'vue-router'
import Layout from '@/views/Layout.vue'
import Home from '@/views/Home/Home.vue'
const Class = () => import('@/views/Class/list.vue')
const Search = () => import('@/views/search')
import Shoes from '@/views/Shoes/index.vue'
import Zahuo from '@/views/zahuo'
const Member = () =>
    import ('@/views/Member/Member.vue')
const Baby = () =>
    import ('@/views/Baby/Baby.vue')
const Suggest = () =>
    import ('@/views/Suggest/Suggest.vue')
const Login = () =>
    import ('@/views/Login.vue')
const Register = () =>
    import ('@/views/Register.vue')
const Food =()=>import('../views/Food')

const routes = [{
        path: '/',
        name: 'Layout',
        component: Layout,
        children: [{
                path: '/',
                component: Home
            },
            {
                path: '/zahuo',
                component: Zahuo
            }
        ]
    },
    {
        path: '/login',
        component: Login
    }, {
        id: 4,
        path: '/shoes',
        component: Shoes
    }, {
        path: '/register',
        component: Register
    }, {
        path: '/cart',
        name: 'Cart',
        component: () =>
            import ('@/views/Cart')
    },
    {
        path: '/class',
        component: Class
      },
      {
        path: '/search',
        component: Search
      },
    {
        path: '/order',
        name: 'Order',
        component: () =>
            import ('@/views/order/checkout.vue')
    },
    {
        path: '/member',
        name: 'member',
        component: Member,
    },
    {
        path: '/baby',
        name: 'baby',
        component: Baby
    },
    {
        path: '/suggest',
        name: 'suggest',
        component: Suggest
    },
    {
        path:'/food',
        name:'food',
        component:Food
    }
]

const router = createRouter({
    // Hash模式
    history: createWebHashHistory(),
    routes
})

export default router